import 'package:app/global_widgets/web_view_page.dart';
import 'package:app/page/chat/binding.dart';
import 'package:app/page/chat/view.dart';
import 'package:app/page/login/view.dart';
import 'package:app/page/main/friend/binding.dart';
import 'package:app/page/main/friend/view.dart';
import 'package:app/page/main/logic.dart';
import 'package:app/page/main/message/view.dart';
import 'package:app/page/main/mine/view.dart';
import 'package:app/page/main/rtc_test.dart/display_media.dart';
import 'package:app/page/main/rtc_test.dart/user_media.dart';
import 'package:app/page/main/view.dart';
import 'package:app/page/rtc/logic.dart';
import 'package:app/page/rtc/view.dart';
import 'package:app/page/splash/view.dart';
import 'package:app/page/welcome/view.dart';
import 'package:get/get.dart';

class RouteConfig {
  ///主页面
  static const String MAIN = "/";

  /// 闪屏页面
  static const String SPLASH = "/splash";

  /// 欢迎页面
  static const String WELCOME = "/welcome";

  /// 登陆页面
  static const String LOGIN = "/login";

  /// 好友界面
  static const String FRIEND = "/friend";

  /// 聊过的好友界面
  static const String MESSAGE = "/message";

  /// 我的界面
  static const String MINE = "/mine";

  //  常规聊天界面
  static const String CHAT = "/chat";

  // 音视频
  static const String RTC = "/rtc";

  /// 网页
  static const String WEB = "/web";

// demo
  static const String DISPLAY_MEDIA = '/display';
  static const String USER_MEDIA = '/user';

  static final List<GetPage> getPages = [
    GetPage(
        name: SPLASH,
        page: () => SplashPage(),
        binding: BindingsBuilder(() {
          // Get.lazyPut<ControllerX>(() => ControllerX());
          // Get.put<Service>(()=> Api());
        })),
    GetPage(
        name: WELCOME,
        page: () => WelcomePage(),
        binding: BindingsBuilder(() {})),
    GetPage(
        name: LOGIN, page: () => LoginPage(), binding: BindingsBuilder(() {})),
    GetPage(
      name: MAIN,
      page: () => MainPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<MainLogic>(() => MainLogic());

        // final MainLogic logic = Get.put(MainLogic());
      }),
    ),
    GetPage(name: MESSAGE, page: () => MessagePage(), binding: FriendBinding()),
    GetPage(name: FRIEND, page: () => FriendPage()),
    GetPage(name: MINE, page: () => MinePage()),
    GetPage(name: CHAT, page: () => ChatPage(), binding: ChatBinding()),
    GetPage(
      name: RTC,
      page: () => RtcPage(),
      binding: BindingsBuilder(() {
        Get.lazyPut<RtcLogic>(() => RtcLogic());
      }),
    ),
    GetPage(name: WEB, page: () => CommonWebViewPage()),
    GetPage(name: DISPLAY_MEDIA, page: () => GetDisplayMediaSample()),
    GetPage(name: USER_MEDIA, page: () => GetUserMediaSample()),
    // GetPage(
    //     name: RTC,
    //     page: () => RtcPage(),
    //     binding: BindingsBuilder(() {
    //       // Get.lazyPut<RtcService>(() => RtcService());
    //       Get.lazyPut<RtcLogic>(() => RtcLogic());
    //     })),
  ];
}
